package day1

object Test4 {
  def main(args: Array[String]): Unit = {
    println("今日重来访")
    test1
    println("不见知音人")
    test1
    println("春风满面皆朋友")
    test1()
    println("遇觅知音难上难")

    test2()
    test3("yy")
    test4("live,life")
    test5(11,99)
    test6("zs","ls","ww","zl","wb","sb")
    test7(10)
    f7(10)
  }

  def test1():Unit={
    println("----------")
  }

  def test2():Unit = {

    return println("567")
  }

  def test3(a:String) = {
    println(a)
  }

  def test4(p:String = "yege") = {
    println(p)
  }

  def test5(p1:Int = 22,p2:Int = 44):String = {
    var p3:Int = p1 + p2
    println(p3)
    return p3.toString
  }

  def test6(p1:String *) = {
    println(p1)
  }

  def test7(args:Int) = {
    var result = 0
    for (i <- 1 to args){
      result += i
      println(result)
    }
  }

  def f7(args: Int*) = {
    var result = 0
    for(arg <- args)
      result += arg
    println(result)

    result match {
      case 1 => "live very bitter"
    }

  }
}
